package com.wgq.uitest;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.wgq.uitest.exp2.Frame;
import com.wgq.uitest.exp2.Grid;
import com.wgq.uitest.exp2.Line;
import com.wgq.uitest.exp2.Relative;
import com.wgq.uitest.exp2.Table;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //进入线性布局
        Button btn1 = (Button) findViewById(R.id.line);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Line.class);
                startActivity(intent);
            }
        });

        //进入相对布局
        Button btn2 = (Button) findViewById(R.id.relative);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Relative.class);
                startActivity(intent);
            }
        });

        //进入帧布局
        Button btn3 = (Button) findViewById(R.id.frame);
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Frame.class);
                startActivity(intent);
            }
        });

        //进入表格布局
        Button btn4 = (Button) findViewById(R.id.table);
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Table.class);
                startActivity(intent);
            }
        });

        //进入网格布局
        Button btn5 = (Button) findViewById(R.id.grid);
        btn5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Grid.class);
                startActivity(intent);
            }
        });
    }
}
